//导入封装后的axios
import axios from './request'

//一个接口封装成一个函数
// 登录
function user_login( params = {} ){
    return axios.post('/api/user/login',params);
}
// 注册
function user_register( params = {} ){
    return axios.post('/api/user/register',params);
}
// 用户角色
function role_list( params = {} ){
    return axios.get('/api/role/list',{params});
}
// 出差申请-添加
function business_add( params = {} ){
    return axios.post('/api/business/add',params);
}
// 出差申请-查询
function business_list( params = {} ){
    return axios.get('/api/business/list',{params});
}
// 出差申请-删除
function business_delete( params = {} ){
    return axios.post('/api/business/delete',params);
}

// 外勤打卡-列表
function outside_list( params = {} ){
    return axios.get('/api/outside/list',{params});
}
// 外勤打卡-添加
function outside_add( params = {} ){
    return axios.post('/api/outside/add',params);
}
// 外勤打卡-删除
function outside_delete( params = {} ){
    return axios.post('/api/outside/delete',params);
}

// 请假申请-列表
function leave_list( params = {} ){
    return axios.get('/api/leave/list',{params});
}
// 请假申请-添加
function leave_add( params = {} ){
    return axios.post('/api/leave/add',params);
}
// 请假申请-删除
function leave_delete( params = {} ){
    return axios.post('/api/leave/delete',params);
}

// 加班申请-列表
function work_list( params = {} ){
    return axios.get('/api/work/list',{params});
}
// 加班申请-添加
function work_add( params = {} ){
    return axios.post('/api/work/add',params);
}
// 加班申请-删除
function work_delete( params = {} ){
    return axios.post('/api/work/delete',params);
}
//导出所有函数
export {
    user_login,
    user_register,
    role_list,
    business_add,
    business_list,
    business_delete,
    outside_list,
    outside_add,
    outside_delete,
    leave_list,
    leave_add,
    leave_delete,
    work_list,
    work_add,
    work_delete,
}